import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: Index,
    meta: {
      istrun: true,
    },
  },
  {
    path: '/esthetics',
    name: 'esthetics',
    component: () => import('../views/Esthetics.vue'),
    meta: {
      istrun: true,
    },
  },
  {
    path: '/housecustom',
    name: 'HouseCustom',
    component: () => import('../views/HouseCustom.vue'),
    meta: {
      istrun: true,
    },
  },
  {
    path: '/aesproducts',
    name: 'aesproducts',
    component: () => import('../views/AesProducts.vue'),
    meta: {
      istrun: false,
    },
    children: [
      {
        path: '/aesgaizao',
        name: 'aesgaizao',
        component: () => import('../views/AesGaizao.vue'),
        meta: {
          istrun: false,
        },
      },
      {
        path: '/aesjiaju',
        name: 'aesjiaju',
        component: () => import('../views/AesJiaju.vue'),
        meta: {
          istrun: false,
        },
      },
      {
        path: '/aesdengju',
        name: 'aesdengju',
        component: () => import('../views/AesDengju.vue'),
        meta: {
          istrun: false,
        },
      },
      {
        path: '/aeschuanglian',
        name: 'aeschuanglian',
        component: () => import('../views/AesChuanglian.vue'),
        meta: {
          istrun: false,
        },
      },
      {
        path: '/aesruanshi',
        name: 'aesruanshi',
        component: () => import('../views/AesRuanshi.vue'),
        meta: {
          istrun: false,
        },
      }
    ]

  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
